import 'package:trade/common/util/ai_json/ai_json.dart';

class UserInfoBean {
  num area_code = 0;
  String avatar = "";
  num gender = 0;
  String name = "";
  String phone = "";
  String reg_time = "";
  String score = "";
  String token = "";
  String password = "";

  UserInfoBean({
    this.area_code = 0,
    this.avatar = "",
    this.gender = 0,
    this.name = "",
    this.phone = "",
    this.reg_time = "",
    this.score = "",
    this.token = "",
    this.password = "",
  });

  factory UserInfoBean.fromJson(Map<String, dynamic> json) {
    AiJson aJson = AiJson(json);
    return UserInfoBean(
      area_code: aJson.getNum("area_code"),
      avatar: aJson.getString("avatar"),
      gender: aJson.getNum('gender'),
      name: aJson.getString('name'),
      phone: aJson.getString('phone'),
      reg_time: aJson.getString('reg_time'),
      score: aJson.getString('score'),
      token: aJson.getString('token'),
      password: aJson.getString('password'),
    );
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['area_code'] = this.area_code;
    data['avatar'] = this.avatar;
    data['gender'] = this.gender;
    data['name'] = this.name;
    data['phone'] = this.phone;
    data['reg_time'] = this.reg_time;
    data['score'] = this.score;
    data['token'] = this.token;
    data['password'] = this.password;
    return data;
  }
}
